<template>
    <h1>Child组件</h1>
    <div>
        <slot name="jian" :age='age'></slot>
    </div>
    <p>{{mes}}</p>
    <button @click="emitxxx">点击分发事件</button>
</template>
<script lang="ts">
import { defineComponent } from 'vue'

export default defineComponent({
    name:"Child",
    data(){
        console.log(this.$attrs);
        return {
            age:18
        }
    },
    props:{
        mes:{
            default:"jiange",
            type:String
        }
    },
    setup(props,context) {
        console.log(context.slots);
        
        // console.log(props);//Proxy {mes: "建哥最帅"}
        // console.log(context);//? {expose: ƒ}
        // console.log(context.attrs.mes1);
        function emitxxx(){
            context.emit("xxx","青春不败");
        }
        return {
            emitxxx
        }
    },
})
</script>
<style scoped>

</style>
